<?php

namespace App\Admin\Controllers;

use App\VideoChannel;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
use Encore\Admin\Show;
use App\VideoChannelUrl;

class VideoChannelUrlController extends AdminController
{
    protected $title = '视频频道链接';

    protected function grid()
    {
        $grid = new Grid(new VideoChannelUrl());

        $grid->column('id', __('ID'))->sortable();
        $grid->column('video_channel_id', __('频道id'));
        $grid->column('url', __('频道链接'));
        $grid->column('created_at', __('Created at'));
        $grid->column('updated_at', __('Updated at'));

        return $grid;
    }

    protected function detail($id)
    {
        $show = new Show(VideoChannelUrl::findOrFail($id));

        $show->field('id', __('ID'));
        $show->field('video_channel_id', __('频道id'));
        $show->field('url', __('频道链接'));
        $show->field('created_at', __('Created at'));
        $show->field('updated_at', __('Updated at'));

        return $show;
    }

    protected function form()
    {
        $form = new Form(new VideoChannelUrl());

        $form->text('video_channel_id',__('频道id'));
        $form->text('url',__('频道链接'));
        $form->text('created_at', __('Created at'));
        $form->text('updated_at', __('Updated at'));

        return $form;
    }
}
